package io;

import java.io.*;

/*
缓冲流：是一对高级流，作用是加快效率
 */
public class CopyDemo3Buffered {
    public static void main(String[] args) throws IOException {
       FileInputStream fis=new FileInputStream("10.jpg");
        BufferedInputStream dis=new BufferedInputStream(fis);
        FileOutputStream fos=new FileOutputStream("10cp.jpg");
        BufferedOutputStream dos=new BufferedOutputStream(fos);
        long sst=System.currentTimeMillis();
        int b;
        if ((b=dis.read())!=-1){
            dos.write(b);
        }
        long len=System.currentTimeMillis();
        System.out.println("复制完毕,耗时"+(len-sst)+"ms");
        dis.close();
        dos.close();

    }
}
